1 CLS:DIMXT,NX,T1,B,XT,X,Y,SL,SY,DY,X(11),Y(11),XX,YY,CX,CY,XC,YC,V,VV,C,G,M,E,R,U,FL,M$(4),I$
2 GOSUB1000:MC=16384:GOTO100
30 XC=0:YC=R:PC=3-2*R
35 GOSUB70
40 IFPC<0THENPC=PC+4*XC+6:GOTO50
45 PC=PC+4*(XC-YC)+10:YC=YC-1   
50 XC=XC+1
55 IFXC<YCTHEN35
60 IFXC=YCTHENGOSUB70 
65 RETURN
70 XX=CX+XC:YY=CY+YC:SET(XX,YY,C)
71 XX=CX-XC:YY=CY+YC:SET(XX,YY,C)
72 XX=CX+XC:YY=CY-YC:SET(XX,YY,C)
73 XX=CX-XC:YY=CY-YC:SET(XX,YY,C)
74 XX=CX+YC:YY=CY+XC:SET(XX,YY,C)
75 XX=CX-YC:YY=CY+XC:SET(XX,YY,C) 
76 XX=CX+YC:YY=CY-XC:SET(XX,YY,C)
77 XX=CX-YC:YY=CY-XC:SET(XX,YY,C)
79 RETURN
100 CLS0:M=.2:U=FL:MM=0:F=0:E=63:C=5:YY=29:FORXX=0TO7:SET(XX,YY,3):NEXT:Y=31:FORX=8TOE-1:SET(X,Y,7):NEXT
110 PRINT@480,"fuel";:CC=0:FORXX=7TO56STEP8:X(0)=XX:Y(0)=29:CC=CC+1
120 X(1)=XX+RND(8):Y(1)=10+RND(10):IF(RND(5)=1ANDF=0)OR(XX>54ANDF=0)THENX(0)=X(0)+1:X(1)=XX+8:Y(1)=29:C=4:F=1:MN=CC
130 GOSUB400:C=5
140 X(0)=X(1):Y(0)=Y(1):X(1)=XX+8:Y(1)=29:GOSUB400
150 NEXT
160 PRINT@59,CHR$(223);CHR$(223);:PRINT@91,CHR$(223);CHR$(223);
170 XX=0:YY=0:C=6:CX=55:CY=4:FORR=2TO3:GOSUB30:NEXT:FORR=1TO5:XX=53+RND(4):YY=2+RND(4):SET(XX,YY,1):NEXT
180 YY=0:FORY=26TO123STEP32:YY=YY+1:M$(YY)="":FORX=0TO3:M$(YY)=M$(YY)+CHR$(PEEK(MC+Y+X)):NEXT:NEXT
190 X=2:Y=27:L=0:V=0
200 SET(X,Y,3):SET(X+1,Y,3):SET(X+2,Y,3):SET(X,Y+1,3):SET(X+2,Y+1,3):I$=INKEY$
210 PRINT@26,M$(1);:PRINT@58,M$(2);:PRINT@90,M$(3);:PRINT@122,M$(4);
220 IFI$="W"THENV=V-M:E=E-U:RESET(E,31):IFE<9THENM=0:U=0
230 IFI$="S"THENL=L+M:E=E-U:RESET(E,31):IFE<9THENM=0:U=0
240 IFI$="A"THENL=L-M:E=E-U:RESET(E,31):IFE<9THENM=0:U=0
250 RESET(X,Y):RESET(X+1,Y):RESET(X+2,Y):RESET(X,Y+1):RESET(X+2,Y+1):V=V+G:Y=Y+V:X=X+L
260 IFY>27THENY=27:VV=V:V=0
265 IFX<0ORX>61ORY<0THEN380
270 ONPOINT(X,Y+2)GOTO280,280,280,350,300,280,280,280
280 ONPOINT(X+2,Y+2)GOTO200,200,200,350,300,200,200,200
290 GOTO200
300 SET(X,Y,3):SET(X+1,Y,3):SET(X+2,Y,3):SET(X,Y+1,3):SET(X+2,Y+1,3):CX=X:CY=Y:C=8:IFX>60THENCX=60
301 IFX<3THENCX=3
310 FORR=0TO3:GOSUB30:NEXT:PRINT@0,"LANDER DESTROYED.";:GOTO700
350 ONPOINT(X+2,Y+2)GOTO300,300,300,355,300,300,300,300
355 ONPOINT(X,Y+2)GOTO300,300,300,360,300,300,300,300
360 IFVV>.5THEN300
370 SET(X,Y,3):SET(X+1,Y,3):SET(X+2,Y,3):SET(X,Y+1,3):SET(X+2,Y+1,3):PRINT@0,"TOUCHDOWN.";
371 MM=MM+1:IFMM=2THENPRINT@32,"MISSION COMPLETE!";:SC=SC+MN*LV*100:PRINT@64,"SCORE=";SC;:GOTO600
372 PRINT@32,"PRESS r TO RE-LAUNCH.";:YY=29:FORXX=0TO5:SET(XX,YY,4):NEXT
374 I$=INKEY$:IFI$<>"R"THEN374
375 GOSUB800:L=0:V=0:GOTO200
380 PRINT@0,"YOU WANDERED INTO ORBIT.";:GOTO700
400 DX=X(1)-X(0):DY=Y(1)-Y(0):SX=SGN(DX):SY=SGN(DY)
440 IFDX=0THEN550
450 SL=DY/DX:B=Y(0)-SL*X(0)
460 T1=SQR(SL*SL+1)
470 NX=1/T1*SX
480 FORXT=X(0)TOX(1)STEPNX:X=INT(XT+.5):Y=INT(SL*XT+B+.5):SET(X,Y,C):NEXT
525 RETURN
550 X=X(0):FORY=Y(0)TOY(1)STEPSY:SET(X,Y,C):NEXT:RETURN
600 PRINT@96,"PRESS c FOR NEXT MISSION.";
610 I$=INKEY$:IFI$=""THEN610
620 IFI$="C"THEN100
630 IFI$="Q"THENEND
640 GOTO610
700 PRINT@32,"PLAY AGAIN (Y/N)?";
710 I$=INKEY$:IFI$=""THEN710
720 IFI$="Y"THENGOSUB1000:GOTO100
730 IFI$="N"THENEND
740 GOTO710
800 PRINT@0,"";:FORXX=1TO23:PRINTCHR$(128);:NEXT
810 PRINT@32,"";:FORXX=1TO23:PRINTCHR$(128);:NEXT:RETURN
1000 MN=0:IFSC>HSTHENHS=SC
1003 SC=0:PRINT@480,"HIGH SCORE=";HS;
1005 PRINT@0,"    * LUNAR LANDER RESCUE *     "
1010 PRINT"YOU MUST PILOT YOUR LUNAR LANDER"
1020 PRINT"TO THE RED LANDING PAD AND BACK."
1030 PRINT"CHOOSE LEVEL (1-3)"
2000 I$=INKEY$:R=RND(1000):IFI$=""THEN2000
2010 IFI$="1"THENG=.03:FL=.7:LV=1:RETURN
2020 IFI$="2"THENG=.035:FL=.7:LV=2:RETURN
2030 IFI$="3"THENG=.04:FL=.7:LV=3:RETURN
2040 GOTO2000
3000 REM LUNAR LANDER RESCUE
3010 REM BY JIM GERRIE
3020 REM COPYRIGHT (C) 2011
